import { getAppData, setGlobalData } from '@utils/tools'
import { AtTabs, AtTabsPane, AtImagePicker } from "taro-ui"
import { BasePage } from '@common/components/base-page'
import NavigationBar from '@components/navBar'
import Taro from '@tarojs/taro';
import Jump from '@utils/jump'
import AppRoute from '@utils/route/index'
import { View, Image, Text, Input, Textarea, Radio, Button, ScrollView } from '@tarojs/components'
import style from './index.module.scss'
import seal from '../../assets/img/seal.png'
import agree from '../../assets/img/agree.png'
interface IProps {
}
interface IState {
    files: any,
    refuse: Boolean,
    pageList: any
}
export default class TaskCheck extends BasePage<IProps, IState> {
    constructor(props) {
        super(props);
        this.state = {
            refuse: false,
            files: [],
            pageList: [
                { title: '任务页面', val: 'https://live.douyin', key: 0 },
                { title: '阅读量', val: '20', key: 1 },
                { title: '点赞量', val: '1', key: 2 },
            ]
        }
    }


    componentDidShow() {

    }
    onChange(files) {
        console.log(files, 'files')
        this.setState({
            files
        })
    }
    onFail(mes) {
        console.log(mes, 'messss')
    }
    onImageClick(index, file) {
        console.log(index, file, 'imageClick')
        Taro.chooseImage({
            success(res) {
                const tempFilePaths = res.tempFilePaths
                Taro.uploadFile({
                    url: 'https://example.weixin.qq.com/upload', //仅为示例，非真实的接口地址
                    filePath: tempFilePaths[0],
                    name: 'file',
                    formData: {
                        'user': 'test'
                    },
                    success(res) {
                        const data = res.data
                        //do something
                    }
                })
            }
        })
    }
    render() {
        const { pageList } = this.state
        const tabList = [{ title: '微信视频号' }, { title: '小红书' }, { title: '抖音' }, { title: '快手' }, { title: '微博' }, { title: 'bilibili' }]
        return (
                <>
                <View className={style.refuseCon}>
                <View className={style.taskBox}>
                    {
                        pageList.map((item) => {
                            return (
                                <View className={style.refuse}>
                                    <Text className={style.textSty}>{item.title}</Text>
                                    <Text className={style.urlSty}>{item.val}</Text>
                                </View>
                            )
                        })
                    }
                    <Image className={style.seal} src={seal}></Image>
                    {/* <Image className={style.seal} src={agree}></Image> */}
                </View>
                <View className={style.refuseInfo}>未通过原因：点赞量未达到500，任务未通</View>
                {/* <View className={style.urls}>
                    <Button>+<Text>添加链接</Text></Button>
                </View> */}
                </View>
                <View className={style.refuseCon}>
                <View className={style.taskBox}>
                    {
                        pageList.map((item) => {
                            return (
                                <View className={style.refuse}>
                                    <Text className={style.textSty}>{item.title}</Text>
                                    <Text className={style.urlSty}>{item.val}</Text>
                                </View>
                            )
                        })
                    }
                    {/* <Image className={style.seal} src={seal}></Image> */}
                    <Image className={style.seal} src={agree}></Image>
                </View>
                {/* <View className={style.refuseInfo}>未通过原因：点赞量未达到500，任务未通</View>
                <View className={style.urls}>
                    <Button>+<Text>添加链接</Text></Button>
                </View> */}
                </View>
                </>
        )
    }
}
